<template>
  <v-page>
    <el-card shadow="never" class="base-card">
      <div class="txt-right" style="margin-bottom: 12px;">
        <el-button type="primary" size="small" icon="el-icon-plus" @click="$refs.dialog.init({})">新增</el-button>
      </div>
      <basic-table ref="basicTable" :columns="columns" :call-server="callServer" :showpagination="false" :height="height"/>
    </el-card>
    <save-dialog ref="dialog" @refresh="reloadData" />
  </v-page>
</template>

<script>
import basicTable from "_c/tables";
import saveDialog from "./components/saveDialog";
import { list } from '#/api/processDef';

// 流程管理
export default {
  components: {
    basicTable,
    saveDialog,
  },
 data() {
    return {
      typeList: [],
      height: window.innerHeight - 188,
    }
  },
  computed: {
    columns() {
      return [
        {
          label: "流程名称",
          prop: "name",
        },
        {
          label: "业务类型",
          prop: "type"
        },
        {
          label: "操作",
          fixed: "right",
          width: "140px",
          render: (h, row) => {
            return (
              <div>
                <el-button type="text" size="middle" class="txt-highlight" onClick={() => this.$refs.dialog.init(row)}>
                  编辑
                </el-button>
              </div>
            );
          },
        },
      ];
    },
  },
  created() {
  },
  methods: {
    callServer() {
      return list
    },
    fecthData() {
      this.$refs.basicTable.fecthData();
    },
    reloadData() {
      this.tableParams = {};
      this.$refs.basicTable.reload();
    },
    getData() {

    }
  },
};
</script>

